<?php
//是否为专家
function isExpert($uid){
	$i = D('space','home')->field('isexpert')->where('uid='.$uid)->find();
	return intval($i['isexpert']);
}

function getUserTags($uid){
	$list = D('SpaceTags','home')->doget($uid);
	foreach ($list as $v){
		$result[] = $v['tagname'];
	}
	return implode('、',$result);
}

function getUserFollow($uid){
	return x('Follow')->getDataCount($uid,'user');
}

function getBlogTags($tags, $tagsName, $suffix = ",", $url) {
	if (strpos ( $tags, ',' ) === false) {
		$data = array (0 => $tags );
	} else {
		$data = explode ( ',', $tags );
	}
	
	if (strpos ( $tagsName, ',' ) === false) {
		$tagsName = array (0 => $tagsName );
	} else {
		$tagsName = explode ( ',', $tagsName );
	}
	$result = array ();
	foreach ( $data as $key => $value ) {
		$temp = array ();
		$temp = U('search/all/index',"type=blog&key={$tagsName [$key]}");
		$result [] = sprintf ( '<a href="%s">%s</a>', $temp, $tagsName [$key] );
	}
	return implode ( $suffix, $result );
}
?>